package com.pearadmin.pro.modules.school.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.school.domain.CourseHours;
import com.pearadmin.pro.modules.school.domain.CourseOutline;
import com.pearadmin.pro.modules.school.param.CourseHoursRequest;
import com.pearadmin.pro.modules.school.repository.CourseHoursRepository;
import com.pearadmin.pro.modules.school.service.CourseHoursService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * 班次上课时间Service业务层处理
 *
 * @author ChenJian
 * @date 2021-08-29
 */
@Service
public class CourseHoursServiceImpl extends ServiceImpl<CourseHoursRepository, CourseHours> implements CourseHoursService
{
    @Resource
    private CourseHoursRepository courseHoursRepository;

    /**
     * 查询班次上课时间
     * @param request
     * @return 班次上课时间 分页集合
     * */
    @Override
    public PageResponse<CourseHours> page(CourseHoursRequest request)
    {
        LambdaQueryWrapper<CourseHours> query = new LambdaQueryWrapper<CourseHours>();
        return Pageable.of(request,(()->  courseHoursRepository.selectList(query)));
    }

    /**
     * 查询班次上课时间
     *
     * @param id 班次上课时间ID
     * @return 班次上课时间
     */
    @Override
    public CourseHours selectCourseHoursById(Long id)
    {
        return courseHoursRepository.selectById(id);
    }

}
